#include <iostream>
#include "RBTree.hpp"
using namespace std;
void TestRBTree() {
	RBTree<int, int> tree;
	int n = 1000000;
	int cnt = 10;
	while (cnt--) {
		srand((unsigned)time(NULL));
		for (int i = 0; i < n; ++i) {
			int num = rand();
			//cout << num << ' ';
			tree.Insert(num, num);
		}
		vector<int> ret = tree.Inorder();
		for (int i = 0; i < ret.size() - 1; ++i) {
			if (ret[i] > ret[i + 1]) {
				cout << "Error!" << endl;
				return;
			}
		}
	}

	cout << "RBTree Test Pass!" << endl;
}
int main() {
	TestRBTree();
	return 0;
}